package com.util;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dao.ThirdInfoDAO;
import com.entity.PageModel;

public class PublicToolShowThirdInfoList {

	public static void searchThirdInfo(HttpServletRequest request,
			HttpServletResponse response, String cp, String key) {

		ThirdInfoDAO cdao = new ThirdInfoDAO();

		int sumCount = cdao.getSumSearchThirdCount(key);

		PageModel pm = PublicToolPageModel
				.getPageInfo(request, sumCount,cp);

		ArrayList<Object> ThirdInfoList = cdao.searchThirdInfo(pm, key);
		request.setAttribute("ThirdInfoList", ThirdInfoList);
	}
	/**
	 * 查询医生信息列表
	 * @param request
	 * @param response
	 * @param cp
	 */
	public static void showThirdInfoList(HttpServletRequest request,
			HttpServletResponse response, String cp) {

		ThirdInfoDAO cdao = new ThirdInfoDAO();

		int sumCount = cdao.getSumThirdCount();
		PageModel pm = PublicToolPageModel.getPageInfo(request, sumCount,cp);

		ArrayList<Object> ThirdInfoList = cdao.getPageModel(pm);
		request.setAttribute("ThirdInfoList", ThirdInfoList);
	}
}
